<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:java="com.fpx.ce.syn.core.xml" exclude-result-prefixes="java" >

    <xsl:output method="xml" />
    <xsl:strip-space elements="*"/>
    <xsl:template match="/resultVo" >
        <response xmlns="http://www.4px.com/xoms/GetLabelInfoResponse">
            <msgType>xoms</msgType>
            <action>getLabelInfo</action>
            <message><xsl:value-of select="data/items/errorMessageCn"/><xsl:value-of select="data/items/errorMessageEn"/><xsl:value-of select="errorMsg"/></message>
            <xsl:apply-templates select="data/items"/>
        </response>
    </xsl:template>
    
    <xsl:template match="data/items">
        <shiporderNo><xsl:value-of select="referenceNumber"/></shiporderNo>
        <trackingNo><xsl:value-of select="trackingNumber"/></trackingNo>
        <declarationData>
            <cargoType><xsl:value-of select="declarationData/cargoType" /></cargoType>
            <diName><xsl:value-of select="declarationData/diName" /></diName>
            <totalValue><xsl:value-of select="declarationData/totalValue" /></totalValue>
            <totalWeight><xsl:value-of select="declarationData/totalWeight" /></totalWeight>
        </declarationData>
        <declareInvoiceData>
            <diEName><xsl:value-of select="declareInvoiceData/diEName" /></diEName>
            <diPcs><xsl:value-of select="declareInvoiceData/diPcs" /></diPcs>
            <diUnitPrice><xsl:value-of select="declareInvoiceData/diUnitPrice" /></diUnitPrice>
        </declareInvoiceData>
        <labelData>
            <chargeZone><xsl:value-of select="labelData/chargeZone" /></chargeZone>
            <city><xsl:value-of select="labelData/city" /></city>
            <companyCode><xsl:value-of select="labelData/companyCode" /></companyCode>
            <chargeZone><xsl:value-of select="labelData/chargeZone" /></chargeZone>
            <consigneeName><xsl:value-of select="labelData/consigneeName" /></consigneeName>
            <countryCode><xsl:value-of select="labelData/countryCode" /></countryCode>
            <countryName><xsl:value-of select="labelData/countryName" /></countryName>
            <customerService><xsl:value-of select="labelData/customerService" /></customerService>
            <highInsureSign><xsl:value-of select="labelData/highInsureSign" /></highInsureSign>
            <insuranceSign><xsl:value-of select="labelData/insuranceSign" /></insuranceSign>
            <productCName><xsl:value-of select="labelData/productCName" /></productCName>
            <productCode><xsl:value-of select="labelData/productCode" /></productCode>
            <productEName><xsl:value-of select="labelData/productEName" /></productEName>
            <productShortName><xsl:value-of select="labelData/productShortName" /></productShortName>
            <returnAddress><xsl:value-of select="labelData/returnAddress" /></returnAddress>
            <returnSign><xsl:value-of select="labelData/returnSign" /></returnSign>
            <sales><xsl:value-of select="labelData/sales" /></sales>
            <stateOrProvince><xsl:value-of select="labelData/stateOrProvince" /></stateOrProvince>
            <street><xsl:value-of select="labelData/street" /></street>
            <zone><xsl:value-of select="labelData/zone" /></zone>
        </labelData>
        <ack><xsl:value-of select="java:XsltFunctions.convertAck(ack)" /></ack>
    </xsl:template>
    
</xsl:stylesheet>

